﻿// See https://aka.ms/new-console-template for more information
using System;
using DarazSdk;
using DarazSdk.Models.Request;
using DarazSdk.Products;

namespace DarazSdk.ConsoleTest // Note: actual namespace depends on the project name.
{
    internal class Program
    {
        static async Task Main(string[] args)
        {
            var client = new DarazClient();


            var request = new ProductRequest()
            {
                Skus = new List<ProductSku>()
                {
                    new ProductSku()
                    {
                        Images= new List<string>(){ "1","2" }
                    }
                }
            };


            var  service = new ProductService(client);


            //请求前触发
            client.OnExecuting += (type, url, body) =>
            {
                Console.WriteLine($"请求类型:{type}");
                Console.WriteLine($"请求地址:{url}");
                Console.WriteLine($"请求内容:{body}");
            };

            //请求后触发
            client.OnExecute += (type, url, body) =>
            {
                Console.WriteLine("\n\n");
                Console.WriteLine($"请求成功类型:{type} \n");
                Console.WriteLine($"请求成功地址:{url} \n");
                Console.WriteLine($"请求成功内容:{body} \n");
            };




            var cps = await service.CreateAsync(request);

            Console.WriteLine();

           
          


            //var uis = await service.UploadImagesAsync(new List<UploadFileInfo>() { new UploadFileInfo() { FilePath = "" } });

        }
    }
}